HAL SD migration: List of applicable concepts ¶
This section provides information about the HAL SD architecture concepts relevant to STM32 HAL1 to HAL2 migration.
Concepts for SD ¶
|
Concept |
Description here |
|---|---|
|
The initialization has been split into separate init and config functions:
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure has been removed from the handle and converted into
|
|
The handle structure has been renamed to
|
|
|
The structure
|
|
|
|
|
|
New APIs are introduced to individually Set and Get specific SD configuration parameters, allowing for more granular control and flexibility:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each SD event. These functions are used to register callback functions for different SD events. |
|
All hardware macros have been removed from the HAL SD driver, and equivalent services are ensured through the LL APIs. |
|
|
The HAL SD functions were updated to return:
|
|
|
All TypeDef parts of the HAL SD driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and states are checked using
|
|
|
HAL2 introduces a more structured and flexible inclusion model compared to HAL1, with a new entry point, conditional flags for module activation, consolidation of extension APIs. User configuration is propagated through dedicated header files. |
|
|
Merge HAL extension files with common ones and remove the EX prefix from APIs. |
Only one HAL SD header file remains and all macros, define statements, and functions from
|
|
Rename LL core drivers to stm32_ppp_core.h/.c to avoid confusion with user LL drivers. |
LL core driver has been renamed from
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
HAL SD provides a new API to retrieve clock frequency
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including SD instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL SD resources and data structures are now prefixed with
|
Other HAL SD changes ¶
|
Concept |
Consideration |
|---|---|
|
Increase performance and add the missing APIs for linked-list management. |
New linked-list management features are added, and most linked-list operations are consolidated in a new HAL. This HAL, called HAL Q, provides advanced linked-list features and is shared between multiple HAL drivers. |